In an object-oriented programming environment, a user typically creates objects that interact with other objects in the environment. Each object in the environment consumes system resources. Examples of such system resources include memory, sockets, and file handles. Thus, when an object is no longer needed, it is desirable to destroy the object, thereby freeing those system resources consumed by that object.
A difficulty associated with destroying an object arises from the manner in which objects are linked to each other. For example, suppose a first object refers to a second object. If the first object is to be destroyed, or if the link between the first and second objects is to be severed, then the second object can also be destroyed, provided no other object in the environment interacts with the second object. However, if any other object in the environment interacts with the second object, then the second object should not be destroyed.
One example of an object-oriented programming environment is an environment for simulating a dynamic system by creating block diagrams in which each block represents a transfer function of a constituent element of the dynamic system. In such an environment, each block is an object that is linked to one or more other blocks. When a first block is removed from the system, it may be possible to remove a second block with which that first block communicates, provided that no other block is linked to that second block.
In principle, it is possible for a de-allocation process to examine each object in the environment to determine whether destruction of a particular object, or the severing of a link between two objects, should trigger destruction of any other objects. However, as the number of objects and the number of links between objects increases, the time required to perform this task quickly becomes prohibitive.